function p = userpath_matlab
%USERPATH User environment path.
%   USERPATH returns a path string containing the current user environment path
%   (if it exists). On UNIX, the userpath is taken from the MATLABPATH
%   environment variable.

%   Copyright 1984-2002 The MathWorks, Inc.
%   $Revision: 1.9.2.1 $ $Date: 2002/10/09 17:36:47 $

% cname = computer;
% if strncmp(cname,'PC',2) %true if win
if ispc==0 % Must be UNIX
    p = [getenv('MATLABPATH') ':'];
    % Remove any redundant toolbox/local
    p = strrep(p,[matlabroot 'toolbox_local'],'');
    p = strrep(p,'::',':');
    p = [p,...
        strcat(pwd,'/toolbox_local:'),...
        strcat(pwd,'/toolbox_local/utilities:') ...
        ];
end
%        strcat(pwd,'/toolbox_local/nnsearcher/mexmaci64:') ...
